import request from '@/router/axios'
import store from '@/store'
import {getLineName, getStationName} from "../../commonCheck";
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  menu:false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  align: 'center',
  selection: true,
  reserveSelection:true,
  addBtn: false,
  column: [
  // {
  //   fixed: true,
  //   label: '主键',
  //   prop: 'id',
  //   span: 24,
  //   hide: true
  // }, 
  {
    width: 100,
    hide: false,
    label: '提交线路',
    prop: 'submitLineCode',
    type: 'select',
    search: true,
    filterable : true,
    formatter: function(row, value , label, column){
      return getLineName(value);
    },
    cascaderItem: ["submitStationCode"],
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: "/check/check/getLineLists?userCode="+ store.getters.userInfo.userCode,
    display: true // 动态显隐控制不能删除
  }, {
    width: 180,
    hide: false,
    label: '提交站点',
    prop: 'submitStationCode',
    type: 'select',
    search: true,
    filterable : true,
    formatter: function(row, value , label, column){
      return getStationName(row.submitLineCode,value);
    },
    dicFlag: false,
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: "/check/check/getStationLists?userCode="+ store.getters.userInfo.userCode + "&lineCode={{key}}",
    display: true// 动态显隐控制不能删除
  },{
    width: 180,
    label: '卡号',
    prop: 'cardOrder',
    hide: false,
    search: true
  },{
    width: 180,
    label: '车站提交金额/次数',
    prop: 'amount',
    hide: false,
    search: false
  },{
    width: 180,
    label: 'ACC回馈金额/次数',
    prop: 'replyAmount',
    hide: false,
    search: false
  },{
    label: '差异',
    prop: 'diffAmount',
    search: false,
    hide: false,
    type:'input',
  }, {
    width: 180,
    label: '进站名称',
    prop: 'inStationName',
    search: false,
    hide: false,
  }, {
    label: '进站时间',
    prop: 'inTime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    width: 90,
    type:'datetime',
    search: false,
    hide: false,
  }, {
    width: 180,
    label: '出站名称',
    prop: 'outStationName',
    search: false,
    hide: false,
  }, {
    hide: false,
    label: '出站时间',
    prop: 'outTime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    width: 90,
    type:'datetime',
    search: false
  }, {
    hide: false,
    label: '录入人',
    prop: 'inputPerson',
    search: false
  },{
    width: 100,
    hide: false,
    label: '录入人工号',
    prop: 'inputPersonCode',
    search: false
  }, {
    hide: false,
    label: '录入时间',
    prop: 'inputTime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    width: 90,
    type:'datetime',
    search: true
  },{
    width: 160,
    hide: false,
    label: '是否加入报表差错',
    formatter:function(row, value , label, column){
      return value == 1?'已加入':'未加入';
    },
    prop: 'isAddReportError',
    search: false
  }, {
    width: 120,
    hide: false,
    label: '下发协查状态',
    prop: 'accDataStatus',
    type: 'select',
    search: true,
    searchLabelWidth:100,
    formatter:function(row, value , label, column){
      return (!value || value == 0)?'待下发':(value==1?'协查中':'已协查');
    },
    dicData: [{
      label: '待下发',
      value: 0
    },{
      label: '协查中',
      value: 1
    },{
      label: '已协查',
      value: 2
    }]
   
  }]
}

export function getSwStTicketInformationCheck(param) {
  return request({
    url: '/check/check/getSwStTicketInformationCheck',
    method: 'post',
    params: param
  })
}
export function updateSwStTicketInformationCheck(param) {
  return request({
    url: '/check/check/updateSwStTicketInformationCheck',
    method: 'post',
    params: param
  })
}

